// Author: lyc
// Deprecated!
// A simple hash set used for memory reserving "vis".

#ifndef HASH_SET_H
#define HASH_SET_H

#include "image.h"
typedef uint8_t hash_set_int;
typedef uint8_t hash_set_bool;

// Width of hash set, i.e. first dimension of "vis".
#define HASH_SET_MAXW 200


typedef struct {
    uint8_t head[HASH_SET_MAXW];
    uint16_t next[100000];
    hash_set_int data[100000];
    int n_cnt;
} HashSet;

// Initialize the hash set, clear all elements.
void hash_set_init(HashSet*, int);

// Insert some element into the hashset.
void hash_set_insert(HashSet*, hash_set_int, hash_set_int);

// Query whether there is an element in this set or not.
hash_set_bool hash_set_query(HashSet*, hash_set_int, hash_set_int);


#endif // HASH_SET_H
